<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:composite="http://java.sun.com/jsf/composite" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
	<ui:composition template="/resources/template/layout.xhtml">
		<ui:define name="contentLayout">


			<p:panel header="Registered Services Equivalents" toggleable="true">
				<p:spacer height="10" style="display:block" />

				<p:selectOneMenu value="#{serviceEquivController.serviceID}" rendered="#{serviceEquivController.selectView}">
					<f:selectItem itemLabel="Select a service" itemValue="" />
					<f:selectItems value="#{serviceEquivController.all}" var="service"
						itemLabel="#{service.virtualServiceName} - #{service.virtualServiceCategory}" itemValue="#{service.serviceID}" />
					<p:ajax event="change" update=":form-layout:pojoPickList" listener="#{serviceEquivController.reload}" />
				</p:selectOneMenu>

				<p:spacer height="5" style="display:block" />
					
				<p:outputPanel autoUpdate="true">
				
					<h:outputText rendered="#{not serviceEquivController.canonical}" value="Before setting equivalent. The transformations for the the canonical model must be loaded." styleClass="error"/>

					<p:spacer height="10" style="display:block" />

					<h:panelGroup layout="block" style="margin: auto; width: 445px;" rendered="#{serviceEquivController.serviceID > 0}">
					
						<p:pickList id="pojoPickList" value="#{serviceEquivController.services}" var="service"
							itemValue="#{service}" itemLabel="#{service.serviceID}" rendered="#{not empty serviceEquivController.serviceID}" converter="entityConverter">
							
							<f:facet name="sourceCaption">Available</f:facet>
							<f:facet name="targetCaption">Equivalents</f:facet>
	
							<p:column style="width:45%">
								#{service.virtualServiceName}
							</p:column>
	
							<p:column style="width:45%"> 
						 	- #{service.virtualServiceCategory}
							</p:column>
	
							<p:column style="width:8%">
								(#{service.serviceID}) 
							</p:column>
							
						</p:pickList>
							 
						<p:commandButton value="save" icon="ui-icon-check" actionListener="#{serviceEquivController.save}" update=":form-layout:pojoPickList" style="float: right;"/>
					
					</h:panelGroup>

					<p:spacer height="40"/>

				</p:outputPanel>
			</p:panel>

		</ui:define>


	</ui:composition>
</h:body>
</html>